package com.ruoyi.crm.service.impl;

import java.util.List;
import com.ruoyi.common.core.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.crm.mapper.PlanCollectionMapper;
import com.ruoyi.crm.domain.PlanCollection;
import com.ruoyi.crm.service.IPlanCollectionService;

/**
 * 收款计划Service业务层处理
 *
 * @author ruoyi
 * @date 2021-09-01
 */
@Service
public class PlanCollectionServiceImpl implements IPlanCollectionService
{
    @Autowired
    private PlanCollectionMapper planCollectionMapper;

    /**
     * 查询收款计划
     *
     * @param id 收款计划主键
     * @return 收款计划
     */
    @Override
    public PlanCollection selectPlanCollectionById(String id)
    {
        return planCollectionMapper.selectPlanCollectionById(id);
    }

    /**
     * 查询收款计划列表
     *
     * @param planCollection 收款计划
     * @return 收款计划
     */
    @Override
    public List<PlanCollection> selectPlanCollectionList(PlanCollection planCollection)
    {
        return planCollectionMapper.selectPlanCollectionList(planCollection);
    }

    /**
     * 新增收款计划
     *
     * @param planCollection 收款计划
     * @return 结果
     */
    @Override
    public int insertPlanCollection(PlanCollection planCollection)
    {
        return planCollectionMapper.insertPlanCollection(planCollection);
    }

    /**
     * 修改收款计划
     *
     * @param planCollection 收款计划
     * @return 结果
     */
    @Override
    public int updatePlanCollection(PlanCollection planCollection)
    {
        planCollection.setUpdateTime(DateUtils.getNowDate());
        return planCollectionMapper.updatePlanCollection(planCollection);
    }

    /**
     * 批量删除收款计划
     *
     * @param ids 需要删除的收款计划主键
     * @return 结果
     */
    @Override
    public int deletePlanCollectionByIds(String[] ids)
    {
        return planCollectionMapper.deletePlanCollectionByIds(ids);
    }

    /**
     * 删除收款计划信息
     *
     * @param id 收款计划主键
     * @return 结果
     */
    @Override
    public int deletePlanCollectionById(String id)
    {
        return planCollectionMapper.deletePlanCollectionById(id);
    }
}